﻿<navigation:Page x:Class="SGTLightAccent.Views.Remitos" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
           xmlns:behaviors="clr-namespace:SGTLightAccent.Models"
          
           Title="Remitos Page"
           DataContext="{Binding Depositos, Source={StaticResource Locator}}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" d:DesignHeight="895" d:DesignWidth="774" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
    <sdk:TabControl Name="tabControl1" TabStripPlacement="Top"  BorderThickness="1" Margin="0,0,0,-39">
        <sdk:TabItem Header="Trabajar con remitos" Height="33" VerticalAlignment="Center" >
            <StackPanel>
                <Border BorderBrush="Silver" BorderThickness="1" Height="213" HorizontalAlignment="Center" Margin="10,10,0,0" Name="borderDescagas" VerticalAlignment="Top" Width="686"  >
                    <Grid Background="White" Margin="0,1,7,0" Height="211" VerticalAlignment="Top" HorizontalAlignment="Right" Width="712">
                    	<sdk:Label Content="N° Carga" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,14,602,0" x:Name="labeld1" VerticalAlignment="Top" Width="62" />
                    	<TextBox Height="28" HorizontalAlignment="Left" IsReadOnly="True" Margin="116,14,0,0" x:Name="textBoxd1" Text="{Binding CargaSeleccionada.Id, Mode=TwoWay}" VerticalAlignment="Top" Width="126" />
                    	<sdk:Label Content="Barco" FontWeight="Bold" Height="28" HorizontalContentAlignment="Right" Margin="48,59,602,0" x:Name="label1" VerticalAlignment="Top" />
                    	<TextBox Height="28" IsReadOnly="True" Margin="116,59,470,0" x:Name="textBox1" Text="{Binding CargaSeleccionada.Barco.Nombre, Mode=TwoWay}" VerticalAlignment="Top" />
                    	<sdk:Label Content="Fecha comienzo" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,14,343,0" x:Name="label2" VerticalAlignment="Top" Width="109" />
                    	<sdk:Label Content="Fecha final" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,61,343,0" x:Name="label3" VerticalAlignment="Top" Width="109" />
                    	<sdk:Label Content="Peso Neto" FontWeight="Bold" Height="28" HorizontalContentAlignment="Right" Margin="302,107,343,0" x:Name="label4" VerticalAlignment="Top" />
                    	<TextBox Height="28" HorizontalAlignment="Left" Margin="375,107,0,0" x:Name="textBox2" VerticalAlignment="Top" Width="126" Text="{Binding Mode=TwoWay, Path=PesoNeto}" />
                    	<sdk:Label Content="Peso ANP" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,107,602,0" x:Name="label5" VerticalAlignment="Top" Width="67" />
                    	<TextBox Height="28" HorizontalAlignment="Left" Margin="116,107,0,0" x:Name="textBox3" Text="{Binding Mode=TwoWay, Path=PesoANP}" VerticalAlignment="Top" Width="126" />
                    	<sdk:DatePicker Height="28" Margin="375,14,211,0" x:Name="datePicker1" VerticalAlignment="Top" SelectedDate="{Binding CargaSeleccionada.Fecha_Ingreso, Mode=TwoWay}" SelectedDateFormat="Short" />
                    	<sdk:DatePicker Height="28" Margin="375,0,211,122" x:Name="datePicker2" VerticalAlignment="Bottom" SelectedDate="{Binding CargaSeleccionada.Fecha_Salida, Mode=TwoWay}" />
                    	<ProgressBar Margin="72,0,52,17" Height="28" VerticalAlignment="Bottom" Maximum="{Binding CargaSeleccionada.Peso}" Value="{Binding PesoNeto, Mode=TwoWay}" />
                    	<sdk:Label Content="Carga esperada" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,16,19,0" x:Name="label4_Copy" VerticalAlignment="Top" Width="105" />
                    	<sdk:Label Content="{Binding CargaSeleccionada.Peso}" Height="28" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="588,61,19,0" x:Name="label4_Copy1" VerticalAlignment="Top" Width="105" d:LayoutOverrides="VerticalAlignment" />
                    	<sdk:Label Height="28" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Margin="53,0,0,17" x:Name="label4_Copy2" VerticalAlignment="Bottom" Width="15" Content="0%" FontSize="10.667" />
                    	<sdk:Label Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Center" Margin="0,0,19,17" x:Name="label4_Copy3" VerticalAlignment="Bottom" Width="29" Content="100%" FontSize="10.667" />
                    	<sdk:Label Height="20" HorizontalContentAlignment="Center" Margin="72,0,52,45" x:Name="label4_Copy4" VerticalAlignment="Bottom" Content="Progreso" FontSize="10.667" FontStyle="Italic" />
                    </Grid>
                </Border>
                <Grid Height="596" Name="grid1" Width="748" Margin="6,20,6,0">
                    <sdk:DataGrid AutoGenerateColumns="False" Margin="0,50,0,100" ItemsSource="{Binding Path=RemitosPaginado}" x:Name="dataGrid2"  SelectionMode="Single" SelectedItem="{Binding Path=RemitoSeleccionado, Mode=TwoWay}" >
                        <sdk:DataGrid.Columns>
                            <sdk:DataGridTextColumn Binding="{Binding Path=Numero_Remito_Carga}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="N° Remito" Width="100" IsReadOnly="True" />
                            <sdk:DataGridTextColumn Binding="{Binding Path=Matricula_Camion}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="MAT" Width="80" IsReadOnly="True" />
                            <sdk:DataGridTextColumn Binding="{Binding Path=Hora_Salida}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Salida" Width="135*" IsReadOnly="True" />
                            <sdk:DataGridTextColumn Binding="{Binding Path=Hora_Llegada}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Llegada" Width="135*" IsReadOnly="True" />

                            <sdk:DataGridTextColumn Binding="{Binding Path=PesoNeto}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Peso Neto" Width="110" IsReadOnly="True"/>
                            <sdk:DataGridTextColumn Binding="{Binding Path=Deposito.Nombre, Mode=OneWay}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Deposito" Width="125" IsReadOnly="True" />
                        </sdk:DataGrid.Columns>
                        <i:Interaction.Behaviors>
                            <behaviors:DataGridDoubleClickBehavior
                                        DoubleClickCommand="{Binding Path=BotonModificarRemito}" 
                                        CommandParameter="{Binding SelectedItem, ElementName=dataGrid2}"
                                        />

                        </i:Interaction.Behaviors>
                        <toolkit:ContextMenuService.ContextMenu>
                            <toolkit:ContextMenu>
                                <toolkit:MenuItem Header="Eliminar remito" Command="{Binding Path=BotonEliminarRemito}" />
                            </toolkit:ContextMenu>
                        </toolkit:ContextMenuService.ContextMenu>

                    </sdk:DataGrid>
                    <toolkit:BusyIndicator IsBusy="{Binding Path=EstaCargando}" DisplayAfter="0" BusyContent="Cargando remitos..." Margin="0,0,0,89">

                    </toolkit:BusyIndicator>
                    <Button Command="{Binding Path=BotonNuevoRemito}" Content="Nuevo" Height="44" HorizontalAlignment="Left" Margin="19,0,0,0" Name="button2" VerticalAlignment="Top" Width="81" />
                    <Button Content="&lt;" Height="44" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="22" Click="button1_Click" />
                    <sdk:DataPager Height="26" Margin="8,507,4,0" Name="dataPager1" PageSize="10" VerticalAlignment="Top" Source="{Binding Path=RemitosPaginado}" DisplayMode="FirstLastPreviousNextNumeric" HorizontalContentAlignment="Right"  />
                </Grid>
            </StackPanel>
        </sdk:TabItem>
    </sdk:TabControl>
</navigation:Page>
